<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 订单表
 * Class Order
 *
 * @since 2.0
 *
 * @Entity(table="order")
 */
class Order extends Model
{
    /**
     * 
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $id;

    /**
     * 购买用户id
     *
     * @Column(name="user_id", prop="userId")
     *
     * @var int
     */
    private $userId;

    /**
     * 商户id
     *
     * @Column(name="merchant_id", prop="merchantId")
     *
     * @var int
     */
    private $merchantId;

    /**
     * 系统交易订单号
     *
     * @Column(name="trade_no", prop="tradeNo")
     *
     * @var string
     */
    private $tradeNo;

    /**
     * 第三方支付订单号
     *
     * @Column(name="out_trade_no", prop="outTradeNo")
     *
     * @var string
     */
    private $outTradeNo;

    /**
     * 订单金额
     *
     * @Column(name="order_amount", prop="orderAmount")
     *
     * @var float
     */
    private $orderAmount;

    /**
     * 折扣金额
     *
     * @Column(name="discount_amount", prop="discountAmount")
     *
     * @var float
     */
    private $discountAmount;

    /**
     * 最终付款金额
     *
     * @Column(name="final_amount", prop="finalAmount")
     *
     * @var float
     */
    private $finalAmount;

    /**
     * 支付时间
     *
     * @Column(name="pay_time", prop="payTime")
     *
     * @var string|null
     */
    private $payTime;

    /**
     * 订单状态，状态信息见配置
     *
     * @Column()
     *
     * @var int
     */
    private $status;

    /**
     * 创建时间
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var string
     */
    private $createdAt;

    /**
     * 更新时间
     *
     * @Column(name="updated_at", prop="updatedAt")
     *
     * @var string
     */
    private $updatedAt;

    /**
     * 软删除时间
     *
     * @Column(name="deleted_at", prop="deletedAt")
     *
     * @var string|null
     */
    private $deletedAt;


    /**
     * @param int $id
     *
     * @return self
     */
    public function setId(int $id): self
    {
        $this->id = $id;

        return $this;
    }

    /**
     * @param int $userId
     *
     * @return self
     */
    public function setUserId(int $userId): self
    {
        $this->userId = $userId;

        return $this;
    }

    /**
     * @param int $merchantId
     *
     * @return self
     */
    public function setMerchantId(int $merchantId): self
    {
        $this->merchantId = $merchantId;

        return $this;
    }

    /**
     * @param string $tradeNo
     *
     * @return self
     */
    public function setTradeNo(string $tradeNo): self
    {
        $this->tradeNo = $tradeNo;

        return $this;
    }

    /**
     * @param string $outTradeNo
     *
     * @return self
     */
    public function setOutTradeNo(string $outTradeNo): self
    {
        $this->outTradeNo = $outTradeNo;

        return $this;
    }

    /**
     * @param float $orderAmount
     *
     * @return self
     */
    public function setOrderAmount(float $orderAmount): self
    {
        $this->orderAmount = $orderAmount;

        return $this;
    }

    /**
     * @param float $discountAmount
     *
     * @return self
     */
    public function setDiscountAmount(float $discountAmount): self
    {
        $this->discountAmount = $discountAmount;

        return $this;
    }

    /**
     * @param float $finalAmount
     *
     * @return self
     */
    public function setFinalAmount(float $finalAmount): self
    {
        $this->finalAmount = $finalAmount;

        return $this;
    }

    /**
     * @param string|null $payTime
     *
     * @return self
     */
    public function setPayTime(?string $payTime): self
    {
        $this->payTime = $payTime;

        return $this;
    }

    /**
     * @param int $status
     *
     * @return self
     */
    public function setStatus(int $status): self
    {
        $this->status = $status;

        return $this;
    }

    /**
     * @param string $createdAt
     *
     * @return self
     */
    public function setCreatedAt(string $createdAt): self
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * @param string $updatedAt
     *
     * @return self
     */
    public function setUpdatedAt(string $updatedAt): self
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * @param string|null $deletedAt
     *
     * @return self
     */
    public function setDeletedAt(?string $deletedAt): self
    {
        $this->deletedAt = $deletedAt;

        return $this;
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return int
     */
    public function getUserId(): ?int
    {
        return $this->userId;
    }

    /**
     * @return int
     */
    public function getMerchantId(): ?int
    {
        return $this->merchantId;
    }

    /**
     * @return string
     */
    public function getTradeNo(): ?string
    {
        return $this->tradeNo;
    }

    /**
     * @return string
     */
    public function getOutTradeNo(): ?string
    {
        return $this->outTradeNo;
    }

    /**
     * @return float
     */
    public function getOrderAmount(): ?float
    {
        return $this->orderAmount;
    }

    /**
     * @return float
     */
    public function getDiscountAmount(): ?float
    {
        return $this->discountAmount;
    }

    /**
     * @return float
     */
    public function getFinalAmount(): ?float
    {
        return $this->finalAmount;
    }

    /**
     * @return string|null
     */
    public function getPayTime(): ?string
    {
        return $this->payTime;
    }

    /**
     * @return int
     */
    public function getStatus(): ?int
    {
        return $this->status;
    }

    /**
     * @return string
     */
    public function getCreatedAt(): ?string
    {
        return $this->createdAt;
    }

    /**
     * @return string
     */
    public function getUpdatedAt(): ?string
    {
        return $this->updatedAt;
    }

    /**
     * @return string|null
     */
    public function getDeletedAt(): ?string
    {
        return $this->deletedAt;
    }

}
